using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using XinBang.BLL;
using XinBang.Entity;
using System.Collections.Generic;
using XinBang.ShoppingCart;

namespace XinBang.Web
{
    public partial class ShoppingRecordPage : System.Web.UI.Page
    {
        private RecordBL rb = new RecordBL();
        private OrderBL ob = new OrderBL();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                if (!string.IsNullOrEmpty(Request.QueryString["id"]))
                {
                    BindRecordList(Convert.ToInt32(Request.QueryString["id"]));
                }
            }
        }

        private void BindRecordList(int id)
        {
            Order order = ob.GetOrderById(id);
            IList<Record> list = rb.GetRecordsByOrderId(id);
            recordList.DataSource = RecordUtil.ConvertRecordListToShoppingCartRecordList(list);
            recordList.DataBind();
        }
    }
}
